﻿using MvcSmartTool.Common;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MvcSmartTool {
    public class ProjectModel : INotifyPropertyChanged {
        public ProjectModel() {
            Types = new ObservableCollection<TypeGenerationModel>();
        }
        #region Properties
        public ObservableCollection<TypeGenerationModel> Types { get; set; }
        public string ProjectOutput {
            get {
                return m_projectOutput;
            }
            set {
                if (m_projectOutput != value) {
                    m_projectOutput = value;
                    NotifyChanged("ProjectOutput");
                }
            }
        }
        public string ProjectName {
            get {
                return m_projectName;
            }
            set {
                if (value != m_projectName) {
                    m_projectName = value;
                    NotifyChanged("ProjectName");
                }
            }
        }
        public bool UsingDll {
            get {
                return m_usingDll;
            }
            set {
                if (m_usingDll != value) {
                    m_usingDll = value;
                    NotifyChanged("UsingDll");
                }
            }
        }
        public string DllPath {
            get {
                return m_dllPath;
            }
            set {
                if (m_dllPath != value) {
                    m_dllPath = value;
                    NotifyChanged("DllPath");
                }
            }
        }
        #endregion Properties
        private void NotifyChanged(string property) {
            if (PropertyChanged != null) {
                this.PropertyChanged(this, new PropertyChangedEventArgs(property));
            }
        }
        public event PropertyChangedEventHandler PropertyChanged;
        private string m_projectName;
        private string m_projectOutput;
        private bool m_usingDll;
        private string m_dllPath;
    }
}
